'use strict';

// 引入egg模块，获取Controller类
const Controller = require('egg').Controller;


// 定义自己的业务处理模块 并继承 Controller 类名尽量和文件名保持一致
class HelloController extends Controller {

  async login() {
    let emp = this.ctx.request.body;
    let loginObject = await this.service.helloSer.login(emp);
     this.ctx.body = {
       code:200,
       loginObject
     }
   }
 
   // 生成验证码
   async verifycode(){
     let svg = await this.service.helloSer.verifycode();
     this.ctx.response.type = "image/svg+xml";
     this.ctx.body = svg.data;
 
   }

}
// 导出业务模块
module.exports = HelloController;

